/*
 * @Description:
 * @Autor: GuluGuluu
 * @Date: 2023-06-24 13:36:30
 * @LastEditors: GuluGuluu
 * @LastEditTime: 2023-06-26 23:29:55
 */
import React from "react";
import { render as renderAmis } from "amis";
import { loginPageConfig } from "./index.config";
import { useAuth } from "../../context/auth-context";

export default function Login() {
  const { login } = useAuth();
  return (
    <>
      {renderAmis(
        loginPageConfig,
        {},
        {
          // 表示从amis表单中拿到数据，并用自实现的请求逻辑处理
          fetcher: ({
            data, // 请求数据
          }) => login(data),
        }
      )}
    </>
  );
}
